package com.example.demo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;


@SpringBootApplication
@EnableScheduling
@MapperScan("com.example.demo.mapper")
public class Demo6Application {

    private static FilterFileConfig filterFileConfig;

    @Value("${file.upload.dir}")
    private static String uploadFilePath;
    //private static PortConfig portConfig;

    @Autowired
    public void setFilterFileConfig(FilterFileConfig filterFileConfig) {

        this.filterFileConfig = filterFileConfig;
    }

    public static void main(String[] args) {
        SpringApplication.run(Demo6Application.class, args);
        //监听2处文件
//        filterFileConfig.FileFilter("/home/lenovo/java/Sub6G");
        filterFileConfig.FileFilter("/home/unicom/tongyijiemian/java_sub6G/Sub6G");

//        //压缩文件夹
//        String sourceFilePath = "D:\\Desktop\\test\\demo6\\data\\ynomt_20220824_222222";
//        String zipFilePath = "D:\\Desktop\\test\\demo6\\data\\ynomt_20220824_222222";
//        String fileName = "ynomt_20220824_222222";
//
//        FileToZip.fileToZip(sourceFilePath, zipFilePath,fileName);
    }

}
